package com.freeman.cement.controller;

import com.alibaba.fastjson.JSONObject;
import com.freeman.cement.annotation.NeedRole;
import com.freeman.cement.entity.ResponseResult;
import com.freeman.cement.entity.Role;
import com.freeman.cement.exception.AppException;
import com.freeman.cement.exception.AppExceptionCodeMsg;
import com.freeman.cement.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/role")
@CrossOrigin    //允许跨域访问
public class RoleController {
    @Resource
    private RoleService service;

    //取得全部工段列表
    //@NeedRole("管理员||值班员")   //这里的分隔符可以是任意的，例如, || 等，这里只要出现权限的名称就可
    @RequestMapping(value = "/selectAllRole", method = RequestMethod.POST)
    public ResponseResult selectAllRole(@RequestParam int pageNo, @RequestParam int pageSize){
        return service.selectRole(pageNo, pageSize);
    }

}
